In this folder we include the R scripts to estimate the ash volume spatial distribution (script "ash_volume_paper") and to disaggregate the total ash volume per pixel across diameter classes using a Weibull distribution (script "volume_disaggregation_diam_class"). We used different software available (R, STATA, MATLAB, QGIS, ARCGIS).

Script sequence:
1) Insheet_all_trees.do (STATA dofile). 
	description: Import and clean the raw data from the French Natiional Forest Inventory
	input data => "arbres_foret_[year].csv"; "placette_foret_[year].csv 
	output data => "allplot.csv"

2) QGIS (no script, manual operation)
	description: for each forest type (1 broadleaved high forest, 2 broadleaved mixed coppice and high 			forest, 3 broadleaved coppice, 5 conifers, 9 others) generate a grid 1x1km grid
			with the percentage of area covered by the respective forest type. The conversion
			between FFSM forest cover type and the chategories in DBforet are available in the 
			file "~Input data\Forest area\reclass.txt", this file contain a phyton function to 				be used in the field calculator in QGIS. Output coordinates: epsg 3035
	input data => DB alti from IGN
	output data => "area1.tif", "area2.tif", "area3.tif", "area5.tif", "area9.tif"


3) Covariates_data_preparation.R (R script)
	description: Import and clean the spatial data for kriging covariates
	input data => 	- digital elevation model DBalti converted in epsg 3035 with QGIS "dbalti3035/hdr.adf"
			- ph data from portail SILVAE "ph_kg_2008/hdr.adf"
			- water stress data from portail SILVAE "de1000ete_moy/hdr.adf"
			- summer evapotranspiration data from portail SILVAE "etrth6190_ete/hdr.adf"
			- area1 used as grid template (so that all rasters have the same grid)
	output data => multiband raster "covars.tif"



4) QGIS (no script, manual operations)
	description: 	merge spatial dataset with the ash volume for each sample plot with the covariates in 
			order to have the value of the covariates for each sample plot.
	input data => 	"allplot.csv" (from (1), data from NFIF, sample plots data with coordinates)
			"covars.tif" (from (3), maps of covariates across france)
	output => spatial data bases containing the following variables: "X" "Y" "vol" "ftype_plot" "soil" 
		"elev" "yret3035" "sret3035" "NomSER" "numser" "wstress" "ph", one for each forest 
		type: "allplot_ft1.csv"; "allplot_ft2.csv"; "allplot_ft3.csv";"allplot_ft5.csv";
 		"allplot_ft9.csv"


5) ash_volume_paper.R (R script)
	description: This code estimates the ash volume spatial distribution using kriging with esternal drift.
			First the code estimates the agerage volume per hectare for each pixel on a 1x1 grid.
			Once the raster with the agerage volume per hectare for each pixel is obrained (within
			each forest type), it is multiplied by the raster with the total forest area per pixel
			(within each forest type).
	input data =>	- sample plot ash volume and covariate data: "allplot_ft1.csv"; "allplot_ft2.csv";
			"allplot_ft3.csv";"allplot_ft5.csv"; "allplot_ft9.csv"
			- covariates for the entire France as in (3) "covars.tif"
			- forest type area per pixel from (2) "area1.tif", "area2.tif", "area3.tif",
			"area5.tif", "area9.tif"
	output data => for each forest type a 1x1 raster with total volume "vol1.tif", "vol2.tif", "vol3.tif",
			"vol5.tif", "vol9.tif" 

			
6) Weibull_input_dataFNFI.do (STATA dofile)
	description: Import and clean data for estimating the Weibull parameter for each silvoecoregion SER
	input data => "arbres_foret_[year].csv"; "placette_foret_[year].csv
	output data => "weib_estim_START_FINAL.csv"


7) reclass_ser.txt (QGIS field calculator function)
	description: reclassify the silvoecoregion with numerical code
	input file => "ser.shp" from IGN
	output file => "ser_final.shp"


9) ser_rasterize.R (R script)
	description => rasterise the SER shapefile using the mask 1x1 km grid 
	input file => 	-"ser_final.shp
			- "mask.tif" (provided in the folder "Input data\Sylvoecoregions\") 
	output file => "ser_final.tif"


10) Disagr_and_EstPar_generate.mat (MATLAB script)
	description: estimate the Weibull parameters for each silvoecoregion SER using data from FNFI and
			computes the share of total volume for each diameter class in each SER using 
			the Weibull cumulative distribution function. 
	input data => "weib_estim_START_FINAL.csv"
	output data =>	- "EstPar.csv" "Disagr.csv" (these files are present in the "Input data" folder)
			- "ser_final.tif"
			- FFSM grid "pxIds.grd"
			- total ash volume 1x1km: "vol1.tif", "vol2.tif", "vol3.tif", "vol5.tif", "vol9.tif"


11) volume_disaggregation_diam_class.R (R script)
	description => This code firstly generates the raster maps for the weibull parameters and then
			disaggregate the total volume per pixel using the estimated voloume diameter
			distribution. The output raster are finally converted to 8x8km grids.
			These files are the input files for FFSM.  
	input data => 	- "EstPar.csv" "Disagr.csv" (these files are present in the "Input data" folder)
			- "ser_final.tif"
			- FFSM grid "pxIds.grd"
			- total ash volume 1x1km: "vol1.tif", "vol2.tif", "vol3.tif", "vol5.tif", "vol9.tif"
	output data =>  - spInput#vol#ash#broadL_highF#1.asc, ... , spInput#vol#ash#broadL_highF#10.asc
			- spInput#vol#ash#broadL_mixedF#1.asc, ... , spInput#vol#ash#broadL_mixedF#10.asc
			- spInput#vol#ash#broadL_copp#1.asc, ... , spInput#vol#ash#broadL_copp#10.asc
			- spInput#vol#ash#conf_highF#1.asc, ... , spInput#vol#ash#conf_highF#10.asc





 


DATA availability and sources

Open access:

- French National Forest Inventory data ("arbres_foret_[year].csv"; "placette_foret_[year].csv) are available at http://inventaire-forestier.ign.fr/spip/

- Sylvoecoregions maps available at http://inventaire-forestier.ign.fr/spip/spip.php?rubrique211

On demand:
- Forest cover map DBforet is available at http://professionnels.ign.fr/bdforet

- Digital elevation model DBalti is available at http://professionnels.ign.fr/bdalti

- Ph data ("ph_kg_2008/hdr.adf"), water stress data ("de1000ete_moy/hdr.adf"), summer evapotranspiration data ("etrth6190_ete/hdr.adf") are available from portail SILVAE (http://silvae.agroparistech.fr/home/)